/**
 * Created by Administrator on 2017/4/15.
 */


var pomelo = require('pomelo');

module.exports = function() {
    return new Filter();
};

var Filter = function() {
};

Filter.prototype.before = function(msg, session, next) {
    delete msg.nolog;
    next();
};

Filter.prototype.after = function(err, msg, session, resp, next) {
    if (msg.nolog) {
        delete msg.nolog;
    } else {
        if (err) {
            logger.info("uid=%d handler %j err=%j", session.uid, msg, err);
        } else {
            logger.debug("uid=%d handler %j resp=%j", session.uid, msg, resp);
        }
    }

    next();
}